import request from "./request";

/** 更新企业信息 */
export const uploadImg = (data) => {
  return request("/hazard/pics", "post", data, {
    "content-type": "multipart/form-data",
  });
};

/** 隐患上报 */
export const reportHidden = (data) => {
  return request("/hazard", "post", data);
};

/** 隐患整改 */
export const fixHidden = (data) => {
  return request("/hazardRectification", "post", data);
};

/** 隐患列表 */
export const getHiddenList = (data) => {
  return request("/hazard/page", "get", data);
};

/** 隐患列表 */
export const getHiddenInfo = (id) => {
  return request("/hazard/details", "get", { id });
};

/**
 * 获取隐患图片列表
 * @param hazardId 隐患ID
 * @returns
 */
export const hiddenDangerImgs = (hazardId) => {
  return request("/hazard/pics", "get", { hazardId });
};

/**
 * 获取隐患图片列表
 * @param hazardId 隐患ID
 * @returns
 */
export const hiddenDangerRectificationImgs = (hazardId) => {
  return request("/hazardRectification/pics/approvedPics", "get", { hazardId });
};
